package com.jzo2o.customer.controller.operation;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.CertificationAuditReqDTO;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 管理端认证信息相关接口
 * @author itcast
 */
@RestController("operationWorkerCertificationAuditController")
@RequestMapping("/operation/worker-certification-audit")
@Api(tags = "管理端 - 服务人员认证信息相关接口")
public class WorkerCertificationAuditController {

@Resource
private IWorkerCertificationAuditService workerCertificationAuditService;

    /**
     * 分页查询认证信息
     * @return
     */
    @GetMapping("/page")
    public PageResult<WorkerCertificationAuditResDTO> pageQuery(WorkerCertificationAuditPageQueryReqDTO workerCertificationAuditPageQueryReqDTO) {
     return workerCertificationAuditService.pageQuery(workerCertificationAuditPageQueryReqDTO);

    }


    @PutMapping("/audit/{id}")
    public void AduitWorkerCertification(@PathVariable("id") Long id,
                                         @RequestBody CertificationAuditReqDTO certificationAuditReqDTO) {
        workerCertificationAuditService.AduitWorkerCertificationAudit(id, certificationAuditReqDTO);
    }

}
